/**
 * 获取所有城市
 * @returns 城市列表
 */
export function getCities(args) {
  return RSocket.rs({
    route: 'prices.get.bus.city',
    args: { ...args },
  });
}

/**
 * 按城市获取所有站点
 * @param {string} cityId
 * @returns 站点列表
 */
export function getStations(cityId) {
  return RSocket.rs({
    route: 'stations',
    args: {
      search: { cityIds: cityId ? [cityId] : [] },
      pg: { size: 1000 },
    },
  });
}

/**
 * 按城市获取所有站点
 * @param {string} cityId
 * @returns 站点列表
 */
export function getBusStation({ fromCity, toCity, direction }) {
  return RSocket.rs({
    route: 'prices.get.bus.station',
    data: {
      fromCities: [fromCity],
      toCities: [...toCity],
      direction,
      priceType: 3,
    },
  });
}

/**
 * 按出发-到达城市获取上车站点信息
 * @param {*} param0
 * @returns
 */
export function getExistStations({ fromCity, toCity, direction }) {
  return RSocket.rs({
    route: 'prices.get.rs.station',
    data: {
      fromCities: [fromCity],
      toCities: [toCity],
      direction,
      priceType: 3,
    },
  });
}

